home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib19b.dsk
/
HIDDEN FILE CREATION.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
5KB
|
116 lines
10 REM ************************
20 REM * HIDDEN.FILE.CREATION *
30 REM * BY R.B. GOLDSTEIN *
40 REM * COPYRIGHT (C) 1984 *
50 REM * BY MICROSPARC, INC. *
60 REM * LINCOLN, MA. 01773 *
70 REM ************************
80 Y$ = "Y":N$ = "N":D$ = CHR$(4):S$ = " "
90 HOME : VTAB 22: PRINT "** COPYRIGHT 1984 BY MICROSPARC, INC. **": VTAB 2: PRINT "TEXT FILE CREATION FOR HIDDEN LINES"
100 PRINT : INPUT "FILE NAME:";F$
110 PRINT : INPUT "NO. OF PTS.=";NP
120 INPUT "NO. OF EDGES=";NE
130 INPUT "NO. OF FACES=";NF
140 INPUT "ANY CHANGES (Y/N)?";Q$
150 Q$ = LEFT$(Q$,1): IF Q$ < >Y$ AND Q$ < >N$ THEN 140
160 IF Q$ = Y$ THEN 100
170 DIM X(NP),Y(NP),Z(NP),F%(NF +1,1),E%(NE,4)
180 PRINT D$"OPEN"F$: PRINT D$"DELETE"F$: PRINT D$"OPEN"F$
190 PRINT D$"WRITE"F$: PRINT NP: PRINT NE: PRINT NF: PRINT D$"CLOSE"F$
200 REM - FILE NAME IS TESTED EARLY
210 REM - INPUT POINTS X,Y,Z
220 HOME : PRINT "TYPE X, Y, Z VALUES ON EACH LINE": PRINT
230 FOR I = 1 TO NP: PRINT "POINT #"I":";: INPUT X(I),Y(I),Z(I): NEXT I
240 GOSUB 1130
250 ON C GOTO 260,320,380
260 I1 = 1:I2 = 20: IF NP <I2 THEN I2 = NP
270 HOME : FOR I = I1 TO I2: PRINT "POINT #"I":"X(I);S$;Y(I);S$;Z(I): NEXT I
280 INPUT "HIT RETURN TO CONTINUE...";H$
290 IF I2 = NP THEN 240
300 I1 = I1 +20:I2 = I2 +20: IF NP <I2 THEN I2 = NP
310 GOTO 270
320 HOME : PRINT "TYPE '0' TO QUIT": INPUT "VALUE # TO BE CORRECTED:";V$
330 V = VAL(V$): IF V = 0 AND V$ = "0" THEN 240
340 IF V <1 OR V >NP THEN 320
350 PRINT "OLD VALUES:";X$(V);S$;Y(V);S$;Z(V)
360 INPUT "NEW VALUES:";X(V),Y(V),Z(V): GOTO 320
370 REM - INPUT FACE DESCRIPTIONS
380 HOME : PRINT "TYPE NO. OF PTS FOR EACH FACE #": PRINT
390 FOR I = 1 TO NF: PRINT "FACE #"I":";: INPUT F%(I,0): NEXT I
400 GOSUB 1130
410 ON C GOTO 420,480,540
420 I1 = 1:I2 = 20: IF NF <I2 THEN I2 = NF
430 HOME : FOR I = I1 TO I2: PRINT "NO. OF PTS. ON FACE #"I":"F%(I,0): NEXT I
440 INPUT "HIT 'RETURN' TO CONTINUE...";H$
450 IF I2 = NF THEN 400
460 I1 = I1 +20:I2 = I2 +20: IF NF <I2 THEN I2 = NF
470 GOTO 430
480 HOME : PRINT "TYPE '0' TO QUIT": INPUT "VALUE # TO BE CORRECTED:";V$
490 V = VAL(V$): IF V = 0 AND V$ = "0" THEN 400
500 IF V <1 OR V >NF THEN 480
510 PRINT "OLD VALUE:";F%(V,0)
520 INPUT "NEW VALUE:";F$(V,0)
530 GOTO 480
540 F%(1,1) = 1: FOR I = 1 TO NF:F%(I +1,1) = F%(I,1) +F%(I,0): NEXT
550 NT = F%(NF +1,1): DIM FP%(NT):L = 1
560 FOR I = 1 TO NF:K = F%(I,0)
570 HOME : PRINT "TYPE IN POINT NOS. FOR FACE #"I
580 PRINT "NO. OF PTS. ON THIS FACE=";K
590 FOR J = 1 TO K
600 PRINT "PT #"J;: INPUT FP%(L):L = L +1
610 NEXT J,I
620 GOSUB 1130
630 ON C GOTO 640,720,820
640 I1 = 1:I2 = 5: IF NF <I2 THEN I2 = NF
650 HOME : FOR I = I1 TO I2: PRINT "FACE #"I: PRINT "POINTS :";
660 K1 = F%(I,1):K2 = F%(I +1,1) -1: FOR K = K1 TO K2: PRINT FP%(K);S$;: NEXT K
670 PRINT : PRINT : NEXT I
680 INPUT "HIT 'RETURN' TO CONTINUE...";H$
690 IF I2 = NF THEN 620
700 I1 = I1 +5:I2 = I2 +5: IF NF <I2 THEN I2 = NF
710 GOTO 650
720 HOME : PRINT "TYPE '0' TO QUIT": INPUT "FACE # TO BE CORRECTED:";V$
730 V = VAL(V$): IF V = 0 AND V$ = "0" THEN 620
740 IF V <1 OR V >NF THEN 720
750 HOME : PRINT "FACE #"V" HAS "F%(V,0)" PTS."
760 PRINT "OLD VALUES :";
770 K1 = F%(V,1):K2 = F%(V +1,1) -1: FOR K = K1 TO K2
780 PRINT FP%(K);S$;: NEXT K
790 PRINT : PRINT : PRINT "NEW VALUES:"
800 FOR L = K1 TO K2: INPUT "PT #";FP%(L): NEXT : GOTO 720
810 REM - INPUT EDGE DESCRIPTIONS
820 HOME : PRINT "NO. OF EDGES =";NE: PRINT : PRINT "FOR EACH EDGE GIVE TWO POINTS AND TWO FACES OR ZEROS"
830 FOR I = 1 TO NE: PRINT : PRINT "EDGE #"I
840 INPUT "POINT #1:";E%(I,1)
850 INPUT "POINT #2:";E%(I,2)
860 INPUT "FACE #1:";E%(I,3)
870 INPUT "FACE #2:";E%(I,4)
880 NEXT
890 GOSUB 1130
900 ON C GOTO 910,980,1050
910 I1 = 1:I2 = 5: IF NE <I2 THEN I2 = NE
920 HOME : FOR I = I1 TO I2: PRINT "EDGE #"I: PRINT "POINTS: "E%(I,1);S$;E%(I,2)
930 PRINT "FACES: "E%(I,3);S$;E%(I,4): PRINT : NEXT I
940 PRINT : INPUT "HIT 'RETURN' TO CONTINUE";H$
950 IF I2 = NE THEN 890
960 I1 = I1 +5:I2 = I2 +5: IF NE <I2 THEN I2 = NE
970 GOTO 920
980 HOME : PRINT "TYPE '0' TO QUIT": INPUT "EDGE # TO BE CORRECTED:";V$
990 V = VAL(V$): IF V = 0 AND V$ = "0" THEN 890
1000 HOME : PRINT "EDGE #"V: PRINT "OLD POINTS:";E%(V,1);S$;E%(V,2): PRINT "OLD FACES:";E%(V,3);S$;E%(V,4): PRINT
1010 INPUT "NEW POINTS :";E%(V,1),E%(V,2)
1020 INPUT "NEW FACES :";E%(V,3),E%(V,4)
1030 GOTO 980
1040 REM - APPEND DISK FILE F$
1050 HOME : PRINT "FILE COMPLETED...WRITE TO DISK"
1060 PRINT D$"APPEND"F$: PRINT D$"WRITE"F$
1070 FOR I = 1 TO NP: PRINT X(I): PRINT Y(I): PRINT Z(I): NEXT
1080 FOR I = 1 TO NF:K = F%(I,0): PRINT K:J1 = F%(I,1):J2 = J1 +K -1
1090 FOR J = J1 TO J2: PRINT FP%(J): NEXT J,I
1100 FOR I = 1 TO NE: FOR J = 1 TO 4: PRINT E%(I,J): NEXT J,I
1110 PRINT D$"CLOSE"F$
1120 END
1130 HOME : PRINT "OPTIONS:"
1140 PRINT "(1) VIEW LIST": PRINT "(2) CORRECT VALUE(S)": PRINT "(3) CONTINUE"
1150 INPUT "CHOICE:";C: IF C <1 OR C >3 THEN 1130
1160 C = INT(C): RETURN